import Vue from 'vue'
import Router from 'vue-router'
import Home from '../pages/Home'
import Categroy from '../pages/Category'

Vue.use(Router)

export default new Router({
 linkActiveClass:"is-active",
  routes: [
    {
      path:"/",
      component:Home
    },
    {
      path:'/category',
      component:function(resolve){
        require(["../pages/Category"],resolve)
      }
    },
     {
      path:'/user',
      component:resolve=>{
        require(["../pages/User"],resolve)
      }
    },
     {
      path:'/recommend',
      component:resolve=>{
        require(["../pages/Recommend"],resolve)
      }
    },
    {
      path:"/roomList/:gameId/:gameName",
      component:resolve=>{
        require(["../pages/RoomList"],resolve)
      }
    },
    {
      path:"/rooms/:roomId/:roomName",
      component:resolve=>{
        require(["../pages/Game"],resolve)
      }
    },
    {
      path:"*",
      redirect:"/"
    }
  ]
})
